import { Common } from '../../utils/common.js';
var common = new Common();

const app = getApp();

Page({
  data: {
    indicatorDots: true,
    autoplay: false,
    interval: 5000,
    duration: 1000
  },

  onLoad: function (options) {
    var token = wx.getStorageSync('token');//获取缓存
    if (!token)
      app.CheckStatus = res => {
        if (res != '')
          this.GetListInfo();
      }
    else
      this.GetListInfo();
  },

  //获取对应文章类型详情
  GetListInfo: function () {
    var that = this;
    var datas = {
      url:'article/list'
    }
    common.ToCallBack(datas,data=>{
      that.setData({
        listinfo:data,
      })
    })
  },

  detail:function(e){
    if(e.currentTarget.dataset.url ==''){
      wx.switchTab({
        url: '../service/service',
      })
    }else{
      wx.navigateTo({
        url: '../outside/outside?url=' + e.currentTarget.dataset.url,
      })
    }
  },
  
  changeIndicatorDots: function(e) {
    this.setData({
      indicatorDots: !this.data.indicatorDots
    })
  },
  changeAutoplay: function(e) {
    this.setData({
      autoplay: !this.data.autoplay
    })
  },
  intervalChange: function(e) {
    this.setData({
      interval: e.detail.value
    })
  },
  durationChange: function(e) {
    this.setData({
      duration: e.detail.value
    })
  }
})









